<?php
    // includes

    include 'includes/config.php';
    include 'includes/webservice.php';
    include 'includes/xml.php';
    include 'includes/funcoes.php';
    include 'includes/retorno.php';
?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
    <?php
    
        try{
            // instâncias
            $funcoes = new Funcoes();
            $retorno = new Retorno($bd_ingres);
           
            $tpo = 'SDT';
            $sequencialTransacao = '619';
            $estrutura = '2014/07/01/'; // ano / mes / dia /
            $arq_xml_rtn = 'arquivos/xml_rtn/' . $estrutura . $sequencialTransacao . '.xml';
            
            $xml = file_get_contents($arq_xml_rtn);
            
            $resultado = $retorno->Processamento($xml,$tpo);  
            
        } catch (Exception $exc) {
            echo '*** Erro Exception : <pre>'.print_r($exc).'</pre> *** </br>';
            //echo '<pre>'.print_r($exc).'</pre>';
            //echo '<br><br><br><br>';
            echo $exc->faultstring;
        }
        
    ?>
    </body>
</html>
